<template>
  <a-layout-sider class="adminleft" collapsible v-model="collapsed">
    <div class="logo" :class="collapsed?'logo1':'logo2'"></div>
    <a-menu theme="dark" @select="select" :defaultSelectedKeys="['首页']" mode="inline">
      <a-menu-item key="首页">
        <a-icon type="pie-chart" />
        <span>首页</span>
      </a-menu-item>
      <a-sub-menu key="课程管理">
        <span slot="title">
          <a-icon type="profile" />
          <span>课程管理</span>
        </span>
        <a-menu-item key="课程">课程</a-menu-item>
        <a-menu-item key="课程组">课程组</a-menu-item>
        <a-menu-item key="课程组类型">课程组类型</a-menu-item>
        <a-menu-item key="代理商课程包">代理商课程包</a-menu-item>
        <a-menu-item key="网页模板">网页模板</a-menu-item>
        <a-menu-item key="序列号组">序列号组</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="用户管理">
        <span slot="title">
          <a-icon type="usergroup-delete" />
          <span>用户管理</span>
        </span>
        <a-menu-item key="用户">用户</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="资源管理">
        <span slot="title">
          <a-icon type="area-chart" />
          <span>资源管理</span>
        </span>
        <a-menu-item key="网盘管理">网盘管理</a-menu-item>
        <a-menu-item key="视频管理">视频管理</a-menu-item>
        <a-menu-item key="课件管理">课件管理</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="教师资料管理">
        <span slot="title">
          <a-icon type="video-camera" />
          <span>教师资料管理</span>
        </span>
        <a-menu-item key="教师资料组">教师资料</a-menu-item>
        <a-menu-item key="题库组">题库组</a-menu-item>
        <a-menu-item key="完成答题">完成答题</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="微信管理">
        <span slot="title">
          <a-icon type="wechat" />
          <span>微信管理</span>
        </span>
        <a-menu-item key="网页管理">网页管理</a-menu-item>
        <a-menu-item key="推送管理">推送管理</a-menu-item>
        <a-menu-item key="粉丝管理">粉丝管理</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="产品视频管理">
        <span slot="title">
          <a-icon type="read" />
          <span>产品视频管理</span>
        </span>
        <a-menu-item key="图书视频">图书视频</a-menu-item>
        <a-menu-item key="机器人视频">机器人视频</a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="校区管理">
        <span slot="title">
          <a-icon type="book" />
          <span>校区管理</span>
        </span>
        <!-- <a-menu-item key="学校首页">学校首页</a-menu-item> -->
        <a-menu-item key="学校列表">校区管理</a-menu-item>
      </a-sub-menu>
      <a-menu-item key="退出">
        <a-icon type="pie-chart" />
        <span>退出</span>
      </a-menu-item>
    </a-menu>
  </a-layout-sider>
</template>

<script>
export default {
  name: "left1",
  data() {
    return {
      collapsed: false
    };
  },
  methods: {
    logout() {
      this.$router.push("/logout");
    },
    select({ key }) {
      this.$router.push({ name: key });
    }
  }
};
</script>

<style scoped>
.adminleft {
  overflow: auto;
  height: 100%;
}

.adminleft::-webkit-scrollbar {
  width: 1px;
  height: 4px;
}
.adminleft::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
}
.adminleft::-webkit-scrollbar-track {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}
#app .logo {
  height: 32px;
  background-repeat: no-repeat;
  background-position-x: center;
  margin: 16px;
  background-size: contain;
  transition: all 0.5s;
}
#app .logo2 {
  background-image: url(https://cdn.hterobot.com/vue/school/image/font-LOGO-1.png);
}

#app .logo1 {
  background-image: url(https://cdn.hterobot.com/vue/school/image/font-LOGO-2.png);
}
</style>
